#!/bin/bash

aurora_rootdir=${HOME}/Public/gitlab18/aurora/
flash_rootdir=${HOME}/Public/gitlab18/flashpro/
aurora_childdir="common;planner/decision;planner/planner;tools"
flash_childdir="common;flash-planning/common;flash-planning/decider;flash-planning/planner"

function update_aurora(){
    dir_array=(${aurora_childdir//;/ })
    for var in ${dir_array[@]}
    do
        echo ${aurora_rootdir}$var
        cd ${aurora_rootdir}$var && git pull
        echo ""
    done
}

function update_flash(){
    dir_array=(${flash_childdir//;/ })
    for var in ${dir_array[@]}
    do
        echo ${flash_rootdir}$var
        cd ${flash_rootdir}$var && git pull
        echo ""
    done
}

if [ "$1" == "aurora" ]; then
    update_aurora
elif [ "$1" == "flash" ]; then
    update_flash
fi